{% extends "base.html" %}
{% block  conetnt %}
    <section class="content-header">
        <h1>教师端管理系统</h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i>课程管理</a></li>
            <li class="active">课程详情</li>
        </ol>
    </section>
    <section class="content" id="showcontent">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">课程详情</h3>
                    </div>
                    {% if messages %}
                        {% for message in messages %}
                            <div class="alert alert-warning"> {{ message }}</div>
                        {% endfor %}
                    {% endif %}

                    {% if course_form.errors %}
                        {% for key,error in course_form.errors.items %}
                            <div class="alert alert-warning">{{ error }} {{ key }}</div>
                        {% endfor %}
                    {% endif %}
                    <form role="form" action="" method="post" enctype="multipart/form-data">
                        <div class="box-body">
                            <div class="form-group">
                                <label for="input_title">{{ course_form.name.label }}</label>
                                {{ course_form.name }}
                            </div>
                            <div class="form-group">
                                <label for="input_info">{{ course_form.desc.label }}</label>
                                {{ course_form.desc }}
                            </div>
                            <div class="form-group">
                                <label for="input_info">{{ course_form.detail.label }}</label>
                                {{ course_form.detail }}
                            </div>


                            <div class="form-group">
                                <label for="input_info">{{ course_form.learn_times.label }}</label>
                                {{ course_form.learn_times }}
                            </div>

                            <div class="form-group">
                                <label for="input_info">{{ course_form.students.label }}</label>
                                {{ course_form.students }}
                            </div>

                            <div class="form-group">
                                <label for="input_info">{{ course_form.fav_nums.label }}</label>
                                {{ course_form.fav_nums }}
                            </div>

                            <div class="form-group">
                                <label for="input_logo">{{ course_form.image.label }}</label>
                                {{ course_form.image }}
                                <img src="{{ MEDIA_URL }}{{ course_form.image.value }}" data-src="holder.js/262x166" style="margin-top:5px;" class="img-responsive" alt="">
                            </div>

                            <div class="form-group">
                                <label for="input_info">{{ course_form.click_nums.label }}</label>
                                {{ course_form.click_nums }}
                            </div>

                            <div class="form-group">
                                <label for="input_info">{{ course_form.tag.label }}</label>
                                {{ course_form.tag }}
                            </div>

                            <div class="form-group">
                                <label for="input_info">{{ course_form.you_need_know.label }}</label>
                                {{ course_form.you_need_know }}
                            </div>

                            <div class="form-group">
                                <label for="input_info">{{ course_form.teacher_tell.label }}</label>
                                {{ course_form.teacher_tell }}
                            </div>

                            <div class="form-group">
                                <label for="input_star">{{ course_form.grade.label }}</label>
                                {{ course_form.grade }}
                            </div>
                            {% csrf_token %}
                        </div>
                        <div class="box-footer">
                            <button type="submit" class="btn btn-primary">修改</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </section>
{% endblock %}